<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="golang"><meta property="og:title" content="golang" />
<meta property="og:description" content="" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://anqicat.gitee.io/doctest/categories/golang/" />
<meta property="og:updated_time" content="2014-04-02T00:00:00+00:00" />
<title>golang | Hugo Book</title>
<link rel="icon" href="/doctest/favicon.png" type="image/x-icon">


<link rel="stylesheet" href="/doctest/book.min.b7fe34b8a4c4da05b2690b4aacfa71ddce0668cc6da3abb67dd3946844125444.css" integrity="sha256-t/40uKTE2gWyaQtKrPpx3c4GaMxto6u2fdOUaEQSVEQ=">


<script defer src="/doctest/en.search.min.9b7f7adbc9ff5cdeb7c8c172b68e544523a3c9a35896de2d296ba8fe913505ab.js" integrity="sha256-m39628n/XN63yMFyto5URSOjyaNYlt4tKWuo/pE1Bas="></script>

<link rel="alternate" type="application/rss+xml" href="https://anqicat.gitee.io/doctest/categories/golang/index.xml" title="Hugo Book" />
<!--
Made with Book Theme
https://github.com/alex-shpak/hugo-book
-->

  
</head>

<body>
  <input type="checkbox" class="hidden" id="menu-control" />
  <main class="container flex">
    <aside class="book-menu">
      
  <nav>
<h2 class="book-brand">
  <a href="/doctest"><span>Hugo Book</span>
  </a>
</h2>


<div class="book-search">
  <input type="text" id="book-search-input" placeholder="Search" aria-label="Search" maxlength="64" data-hotkeys="s/" />
  <div class="book-search-spinner spinner hidden"></div>
  <ul id="book-search-results"></ul>
</div>





  

  
  





 
  
    




  
  <ul>
    
      
        

  <li  class="book-section-flat" >
    
      

  <a href="/doctest/docs/example/" >
      Example Site
  </a>


    

    




  
  <ul>
    
      
        

  <li >
    
      

  <a href="/doctest/docs/example/table-of-contents/" >
      Docs\example\table of Contents\
  </a>


    

    




  
  <ul>
    
      
        <li>

  <a href="/doctest/docs/example/table-of-contents/with-toc/" >
      With ToC
  </a>

</li>
      
    
      
        <li>

  <a href="/doctest/docs/example/table-of-contents/without-toc/" >
      Without ToC
  </a>

</li>
      
    
  </ul>
  



  </li>


      
    
      
        

  <li >
    
      

  <a href="/doctest/docs/example/2nd/" >
      Docs\example\2nd\
  </a>


    

    






  </li>


      
    
  </ul>
  



  </li>


      
    
      
        

  <li  class="book-section-flat" >
    
      <span>Docs\shortcodes\</span>
    

    




  
  <ul>
    
      
        <li>

  <a href="/doctest/docs/shortcodes/buttons/" >
      Buttons
  </a>

</li>
      
    
      
        <li>

  <a href="/doctest/docs/shortcodes/columns/" >
      Columns
  </a>

</li>
      
    
      
        <li>

  <a href="/doctest/docs/shortcodes/expand/" >
      Expand
  </a>

</li>
      
    
      
        <li>

  <a href="/doctest/docs/shortcodes/hints/" >
      Hints
  </a>

</li>
      
    
      
        <li>

  <a href="/doctest/docs/shortcodes/katex/" >
      Katex
  </a>

</li>
      
    
      
        <li>

  <a href="/doctest/docs/shortcodes/mermaid/" >
      Mermaid
  </a>

</li>
      
    
      
        <li>

  <a href="/doctest/docs/shortcodes/tabs/" >
      Tabs
  </a>

</li>
      
    
  </ul>
  



  </li>


      
    
  </ul>
  



  











</nav>


<script>
(function() {
  var menu = document.querySelector("aside.book-menu nav");
  addEventListener("beforeunload", function(event) {
    localStorage.setItem("menu.scrollTop", menu.scrollTop);
  });
  menu.scrollTop = localStorage.getItem("menu.scrollTop");
})();
</script>

 
    </aside>

    <div class="book-page">
      <header class="book-header">
        
  <div class="flex align-center justify-between">
  <label for="menu-control">
    <img src="/doctest/svg/menu.svg" class="book-icon" alt="Menu" />
  </label>

  <strong>golang</strong>

  <label for="toc-control">
    <img src="/doctest/svg/toc.svg" class="book-icon" alt="Table of Contents" />
  </label>
</div>


  
    <input type="checkbox" class="hidden" id="toc-control" />
    <aside class="hidden clearfix">
      
  <nav>
  <ul>
  
    
    <li class="book-section-flat">
      <strong>Categories</strong>
      <ul>
      
        <li>
          <a href="/doctest/categories/Development/">Development</a>
        </li>
      
        <li>
          <a href="/doctest/categories/golang/">golang</a>
        </li>
      
      </ul>
    </li>
    
  
    
    <li class="book-section-flat">
      <strong>Tags</strong>
      <ul>
      
        <li>
          <a href="/doctest/tags/development/">development</a>
        </li>
      
        <li>
          <a href="/doctest/tags/go/">go</a>
        </li>
      
        <li>
          <a href="/doctest/tags/golang/">golang</a>
        </li>
      
        <li>
          <a href="/doctest/tags/hugo/">hugo</a>
        </li>
      
        <li>
          <a href="/doctest/tags/templates/">templates</a>
        </li>
      
        <li>
          <a href="/doctest/tags/themes/">themes</a>
        </li>
      
      </ul>
    </li>
    
  
  </ul>
</nav>


    </aside>
  
 
      </header>

      
  
  
  <article class="markdown book-post">
    <h2>
      <a href="/doctest/posts/goisforlovers/">(Hu)go Template Primer</a>
    </h2>
    

<div>

  <h5>Apr 2, 2014</h5>



  
  <div>
    
        <a href="/doctest/categories/Development/">Development</a>, 
        <a href="/doctest/categories/golang/">golang</a>
  </div>
  

  
  <div>
    
        <a href="/doctest/tags/go/">go</a>, 
        <a href="/doctest/tags/golang/">golang</a>, 
        <a href="/doctest/tags/templates/">templates</a>, 
        <a href="/doctest/tags/themes/">themes</a>, 
        <a href="/doctest/tags/development/">development</a>
  </div>
  


</div>


    <p>Hugo uses the excellent Go html/template library for its template engine. It is an extremely lightweight engine that provides a very small amount of logic. In our experience that it is just the right amount of logic to be able to create a good static website. If you have used other template systems from different languages or frameworks you will find a lot of similarities in Go templates.
This document is a brief primer on using Go templates.
      <a href="/doctest/posts/goisforlovers/">...</a>
      
    </p>
  </article>
  
  <article class="markdown book-post">
    <h2>
      <a href="/doctest/posts/hugoisforlovers/">Getting Started with Hugo</a>
    </h2>
    

<div>

  <h5>Apr 2, 2014</h5>



  
  <div>
    
        <a href="/doctest/categories/Development/">Development</a>, 
        <a href="/doctest/categories/golang/">golang</a>
  </div>
  

  
  <div>
    
        <a href="/doctest/tags/go/">go</a>, 
        <a href="/doctest/tags/golang/">golang</a>, 
        <a href="/doctest/tags/hugo/">hugo</a>, 
        <a href="/doctest/tags/development/">development</a>
  </div>
  


</div>


    <p>Step 1. Install Hugo Go to Hugo releases and download the appropriate version for your OS and architecture.
Save it somewhere specific as we will be using it in the next step.
More complete instructions are available at Install Hugo
Step 2. Build the Docs Hugo has its own example site which happens to also be the documentation site you are reading right now.
Follow the following steps:
 Clone the Hugo repository Go into the repo Run hugo in server mode and build the docs Open your browser to http://localhost:1313  Corresponding pseudo commands:
      <a href="/doctest/posts/hugoisforlovers/">...</a>
      
    </p>
  </article>
  
  


 

      <footer class="book-footer">
        
  <div class="flex justify-between">

  


  

  

  



<div class="book-languages">

  <ul>
    <li class="flex">
      <img src="/doctest/svg/translate.svg" class="book-icon" alt="Languages" />
      English
    </li> 
  </ul>

  <ul class="book-languages-list">
    
    <li class="">
      <a href="https://anqicat.gitee.io/doctest/cn/" class="flex">
        <img src="/doctest/svg/translate.svg" class="book-icon" alt="Languages" />
        Chinese
      </a>
    </li>
    
    <li class="active">
      <a href="https://anqicat.gitee.io/doctest/" class="flex">
        <img src="/doctest/svg/translate.svg" class="book-icon" alt="Languages" />
        English
      </a>
    </li>
    
    <li class="">
      <a href="https://anqicat.gitee.io/doctest/ru/" class="flex">
        <img src="/doctest/svg/translate.svg" class="book-icon" alt="Languages" />
        Russian
      </a>
    </li>
    
  </ul>

</div>






</div>

 
        
  
 
      </footer>
      
    </div>

    
    <aside class="book-toc">
      
  <nav>
  <ul>
  
    
    <li class="book-section-flat">
      <strong>Categories</strong>
      <ul>
      
        <li>
          <a href="/doctest/categories/Development/">Development</a>
        </li>
      
        <li>
          <a href="/doctest/categories/golang/">golang</a>
        </li>
      
      </ul>
    </li>
    
  
    
    <li class="book-section-flat">
      <strong>Tags</strong>
      <ul>
      
        <li>
          <a href="/doctest/tags/development/">development</a>
        </li>
      
        <li>
          <a href="/doctest/tags/go/">go</a>
        </li>
      
        <li>
          <a href="/doctest/tags/golang/">golang</a>
        </li>
      
        <li>
          <a href="/doctest/tags/hugo/">hugo</a>
        </li>
      
        <li>
          <a href="/doctest/tags/templates/">templates</a>
        </li>
      
        <li>
          <a href="/doctest/tags/themes/">themes</a>
        </li>
      
      </ul>
    </li>
    
  
  </ul>
</nav>

 
    </aside>
    
  </main>

  
</body>

</html>












